import fetch from '@/utils/request';

const ORDER_URL = '/api/user/order';
const VIP_ORDER_URL = '/api/user/vip/order';
/**
 * 订单API对象
 * @module VipOrderApi
 */
const VipOrderApi = {
	/**
	 * @function buy
	 * @description 购买
	 * @param  {Object} param ？？？
	 */
	buy: (param) => fetch.request({
		url: `${VIP_ORDER_URL}/buy`,
		method: 'POST',
		data: {
			param: param
		}
	}),
	/**
	 * @function confirm
	 * @description 得到缓存中的订单
	 */
	confirm: () => fetch.request({
		url: `${VIP_ORDER_URL}/confirm`,
		method: 'POST',
	}),
};


 export default VipOrderApi;

// import {
// 	request
// } from '@/utils/request';
// /**
//  * vip订单对象
//  * @module VipOrder
//  */
// class VipOrder extends Order {
// 	//
// 	constructor(path, vipPath) {
// 		super(path);
// 		this.vipPath = vipPath;
// 	};

// 	buy = (param) => request({
// 		url: `${this.vipPath}/buy`,
// 		method: 'POST',
// 		data: {
// 			param: param
// 		},
// 	});

// 	confirm = () => request({
// 		url: `${this.vipPath}/confirm`,
// 		method: 'POST',
// 	})
// }

// export default new VipOrder("/api/user/order", "/api/user/vip/order");